//
//  SXTThirdLandingView.m
//  8.18项目
//
//  Created by ma c on 16/8/18.
//  Copyright © 2016年 zhang. All rights reserved.
//

#import "SXTThirdLandingView.h"

@interface SXTThirdLandingView ()

@property (nonatomic,strong) UIButton * QQLoginBtn;
@property (nonatomic,strong) UIButton * sinaloginBtn;
@property (nonatomic,strong) UIButton * WXLoginBtn;
@property (nonatomic,strong) UILabel * bottomTostLabel;
@property (nonatomic,strong) UILabel * bottomLineLabel;

@end

@implementation SXTThirdLandingView

-(instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    if (self) {
        
        [self addSubview:self.bottomLineLabel];
        [self addSubview:self.bottomTostLabel];
        [self addSubview:self.QQLoginBtn];
        [self addSubview:self.sinaloginBtn];
        [self addSubview:self.WXLoginBtn];
    }
    return self;
}

-(void)layoutSubviews{

    [super layoutSubviews];
    
    __weak typeof(self) weakSelf = self;
    [_bottomLineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.mas_top).offset(26);
        make.left.equalTo(weakSelf.mas_left).offset(16);
        make.right.equalTo(weakSelf.mas_right).offset(-16);
        make.height.equalTo(@1);
    }];
    
    [_bottomTostLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(85, 16));
        make.centerX.equalTo(weakSelf.bottomLineLabel.mas_centerX);
        make.centerY.equalTo(weakSelf.bottomLineLabel.mas_centerY);
    }];
    
    [_QQLoginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(45, 45));
        make.top.equalTo(weakSelf.bottomLineLabel.mas_bottom).offset(25);
        make.right.equalTo(weakSelf.WXLoginBtn.mas_left).offset(-(VIEW_WIDTH-135)/4);
    }];
    
    [_WXLoginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(45, 45));
        make.top.equalTo(weakSelf.bottomLineLabel.mas_bottom).offset(25);
        make.centerX.equalTo(weakSelf.mas_centerX);
    }];
    
    [_sinaloginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(45, 45));
        make.top.equalTo(weakSelf.bottomLineLabel.mas_bottom).offset(25);
        make.left.equalTo(weakSelf.WXLoginBtn.mas_right).offset((VIEW_WIDTH-135)/4);
    }];
   
}



//初始化
-(UIButton *)QQLoginBtn{

    if (!_QQLoginBtn) {
        _QQLoginBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [_QQLoginBtn setImage:[UIImage imageNamed:@"登录界面qq登陆"] forState:(UIControlStateNormal)];
    }
    return _QQLoginBtn;
}
-(UIButton *)sinaloginBtn{
    if (!_sinaloginBtn) {
        _sinaloginBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [_sinaloginBtn setImage:[UIImage imageNamed:@"登陆界面微博登录"] forState:(UIControlStateNormal)];
    }
    return _sinaloginBtn;
}
-(UIButton *)WXLoginBtn{

    if (!_WXLoginBtn) {
        _WXLoginBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [_WXLoginBtn setImage:[UIImage imageNamed:@"登录界面微信登录"] forState:(UIControlStateNormal)];
    }
    return _WXLoginBtn;
}
-(UILabel *)bottomTostLabel{
    if (!_bottomTostLabel) {
        _bottomTostLabel = [[UILabel alloc]init];
        _bottomTostLabel.text = @"一键登录";
        _bottomTostLabel.font = [UIFont systemFontOfSize:16.0];
        _bottomTostLabel.textColor = RGB(190, 190, 190);
        _bottomTostLabel.backgroundColor = MainColor;
        _bottomTostLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _bottomTostLabel;
}
-(UILabel *)bottomLineLabel{
    if (!_bottomLineLabel) {
        _bottomLineLabel = [[UILabel alloc]init];
        _bottomLineLabel.backgroundColor = RGB(223, 223, 223);
    }
    return _bottomLineLabel;
}








@end
